/*
 * Copyright (c) 2024 vitasystems GmbH
 *
 * This file is part of project EHRbase Migration Tool
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ehrbase.migration.importer.v4.jooq.pg.tables.records;

import java.time.OffsetDateTime;
import java.util.UUID;
import org.ehrbase.migration.importer.v4.jooq.pg.tables.TemplateStore;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record4;
import org.jooq.Row4;
import org.jooq.impl.UpdatableRecordImpl;

/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({"all", "unchecked", "rawtypes", "this-escape"})
public class TemplateStoreRecord extends UpdatableRecordImpl<TemplateStoreRecord>
        implements Record4<UUID, String, String, OffsetDateTime> {

    private static final long serialVersionUID = 1L;

    /**
     * Setter for <code>ehr.template_store.id</code>.
     */
    public void setId(UUID value) {
        set(0, value);
    }

    /**
     * Getter for <code>ehr.template_store.id</code>.
     */
    public UUID getId() {
        return (UUID) get(0);
    }

    /**
     * Setter for <code>ehr.template_store.template_id</code>.
     */
    public void setTemplateId(String value) {
        set(1, value);
    }

    /**
     * Getter for <code>ehr.template_store.template_id</code>.
     */
    public String getTemplateId() {
        return (String) get(1);
    }

    /**
     * Setter for <code>ehr.template_store.content</code>.
     */
    public void setContent(String value) {
        set(2, value);
    }

    /**
     * Getter for <code>ehr.template_store.content</code>.
     */
    public String getContent() {
        return (String) get(2);
    }

    /**
     * Setter for <code>ehr.template_store.creation_time</code>.
     */
    public void setCreationTime(OffsetDateTime value) {
        set(3, value);
    }

    /**
     * Getter for <code>ehr.template_store.creation_time</code>.
     */
    public OffsetDateTime getCreationTime() {
        return (OffsetDateTime) get(3);
    }

    // -------------------------------------------------------------------------
    // Primary key information
    // -------------------------------------------------------------------------

    @Override
    public Record1<UUID> key() {
        return (Record1) super.key();
    }

    // -------------------------------------------------------------------------
    // Record4 type implementation
    // -------------------------------------------------------------------------

    @Override
    public Row4<UUID, String, String, OffsetDateTime> fieldsRow() {
        return (Row4) super.fieldsRow();
    }

    @Override
    public Row4<UUID, String, String, OffsetDateTime> valuesRow() {
        return (Row4) super.valuesRow();
    }

    @Override
    public Field<UUID> field1() {
        return TemplateStore.TEMPLATE_STORE.ID;
    }

    @Override
    public Field<String> field2() {
        return TemplateStore.TEMPLATE_STORE.TEMPLATE_ID;
    }

    @Override
    public Field<String> field3() {
        return TemplateStore.TEMPLATE_STORE.CONTENT;
    }

    @Override
    public Field<OffsetDateTime> field4() {
        return TemplateStore.TEMPLATE_STORE.CREATION_TIME;
    }

    @Override
    public UUID component1() {
        return getId();
    }

    @Override
    public String component2() {
        return getTemplateId();
    }

    @Override
    public String component3() {
        return getContent();
    }

    @Override
    public OffsetDateTime component4() {
        return getCreationTime();
    }

    @Override
    public UUID value1() {
        return getId();
    }

    @Override
    public String value2() {
        return getTemplateId();
    }

    @Override
    public String value3() {
        return getContent();
    }

    @Override
    public OffsetDateTime value4() {
        return getCreationTime();
    }

    @Override
    public TemplateStoreRecord value1(UUID value) {
        setId(value);
        return this;
    }

    @Override
    public TemplateStoreRecord value2(String value) {
        setTemplateId(value);
        return this;
    }

    @Override
    public TemplateStoreRecord value3(String value) {
        setContent(value);
        return this;
    }

    @Override
    public TemplateStoreRecord value4(OffsetDateTime value) {
        setCreationTime(value);
        return this;
    }

    @Override
    public TemplateStoreRecord values(UUID value1, String value2, String value3, OffsetDateTime value4) {
        value1(value1);
        value2(value2);
        value3(value3);
        value4(value4);
        return this;
    }

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    /**
     * Create a detached TemplateStoreRecord
     */
    public TemplateStoreRecord() {
        super(TemplateStore.TEMPLATE_STORE);
    }

    /**
     * Create a detached, initialised TemplateStoreRecord
     */
    public TemplateStoreRecord(UUID id, String templateId, String content, OffsetDateTime creationTime) {
        super(TemplateStore.TEMPLATE_STORE);

        setId(id);
        setTemplateId(templateId);
        setContent(content);
        setCreationTime(creationTime);
        resetChangedOnNotNull();
    }
}
